/**
 * 
 */
package at.jku.ssw.fortress.ui.outline;

import org.eclipse.jface.viewers.LabelProvider;
import org.eclipse.swt.graphics.Image;

import at.jku.ssw.fortress.ui.FortressPlugin;
import at.jku.ssw.fortress.util.ImageManager;

public final class OutlineLabelProvider extends LabelProvider {
	private ImageManager imageManager = FortressPlugin.getDefault().getImageManager();

	@Override
	public String getText(Object e) {
		Definition def = (Definition) e;
		return def.getText();
	}

	@Override
	public Image getImage(Object e) {
		Definition def = (Definition) e;
		String path = def.getImage();
		if(path != null) {
			return imageManager.getImage(path);
		}
		return null;
	}
}